<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<a href="/student/toAdd">添加</a>
<table border="1">
    <tr>
        <td>序号</td>
        <td>名字</td>
        <td>性别</td>
        <td>年龄</td>
        <td>出生日期</td>
        <td>操作</td>
    </tr>
    <tr th:each="student:${list.getList()}">
        <td th:text="${student.id}"/>
        <td th:text="${student.name}"/>
        <td th:text="${student.sex}"/>
        <td th:text="${student.age}"/>
        <td th:text="${#dates.format(student.birthday,'yyyy-MM-dd')}"/>
        <td>
            <a th:href="@{/student/findById(id=${student.getId()})}">修改</a>
            <a th:href="@{/student/delete(id=${student.getId()})}">删除</a>
        </td>
    </tr>
</table>
<button><a href="/student/findAll?pageNum=1">首页</a></button>
<button><a th:href="@{/student/findAll(pageNum=${list.prePage})}">上一页</a></button>
<span th:each="n:${list.getNavigatepageNums()}">
         <button type="button">
             <a th:href="@{/student/findAll(pageNum=${n})}">
                 <span th:text="${n}"></span>
             </a>
         </button>
    </span>
<button><a th:href="@{/student/findAll(pageNum=${list.nextPage})}">下一页</a></button>
<button>
    <a th:href="@{/student/findAll(pageNum=${list.pages})}">尾页</a>
</button>
共<span th:text="${list.total}"/>条数据，第<span th:text="${list.pageNum}"/>页/共<span th:text="${list.pages}"/>页
</body>
</html>
